package com.example.udpsocket;

import android.os.Handler;
import android.os.Message;

import com.zdj.utils.MyLogUtil;

import java.util.HashMap;
import java.util.Map;

public class MsgProcess {
    private static final String TAG = "MsgProcess";
    private static final int COMPLETED = 0;
    public static Handler handler;

    /**
     * 消息计数
     */
    @Deprecated
    public static int count = 0;
    /**
     * 不同消息类型的消息计数
     */
    public Map<Integer, Integer> messageCounts;

    public MsgProcess() {
        messageCounts = new HashMap<>();
    }

    /**
     * 被底层回调的方法
     *
     * @param msg
     */
    public static void subcallback(String msg) {
        MyLogUtil.e(TAG, "subcallback: \n" + msg);
        Message msgobj = new Message();
        msgobj.obj = msg;
        handler.sendMessage(msgobj);

    }
}
